package io;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class CopyDemo {
    public static void main(String[] args) throws IOException {

        //1.创建源
        FileInputStream fis=new FileInputStream("./image.png");
        //2.创建目的地
        FileOutputStream fos=new FileOutputStream("./image2.png");
        int d;
        long  start=System.currentTimeMillis();
        while((d= fis.read())!=-1){
            fos.write(d);
        }
        long eng =System.currentTimeMillis();
        System.out.println("复制耗时时间："+(eng-start)+"mc-+");
        System.out.println("复制完成");
        fis.close();
        fos.close();

    }
}
